import 'package:healthy_station_flutter/generated/json/base/json_convert_content.dart';
import 'package:healthy_station_flutter/entity/login_entity.dart';

LoginEntity $LoginEntityFromJson(Map<String, dynamic> json) {
  final LoginEntity loginEntity = LoginEntity();
  final String? account = jsonConvert.convert<String>(json['account']);
  if (account != null) {
    loginEntity.account = account;
  }
  final String? passwd = jsonConvert.convert<String>(json['passwd']);
  if (passwd != null) {
    loginEntity.passwd = passwd;
  }
  final String? mobilephone = jsonConvert.convert<String>(json['mobilephone']);
  if (mobilephone != null) {
    loginEntity.mobilephone = mobilephone;
  }
  final String? phoneCode = jsonConvert.convert<String>(json['phoneCode']);
  if (phoneCode != null) {
    loginEntity.phoneCode = phoneCode;
  }
  final String? loginModel = jsonConvert.convert<String>(json['loginModel']);
  if (loginModel != null) {
    loginEntity.loginModel = loginModel;
  }
  final String? machineId = jsonConvert.convert<String>(json['machineId']);
  if (machineId != null) {
    loginEntity.machineId = machineId;
  }
  final String? usr = jsonConvert.convert<String>(json['usr']);
  if (usr != null) {
    loginEntity.usr = usr;
  }
  final String? ccd = jsonConvert.convert<String>(json['ccd']);
  if (ccd != null) {
    loginEntity.ccd = ccd;
  }
  final String? token = jsonConvert.convert<String>(json['token']);
  if (token != null) {
    loginEntity.token = token;
  }
  final String? videoAccount = jsonConvert.convert<String>(
      json['videoAccount']);
  if (videoAccount != null) {
    loginEntity.videoAccount = videoAccount;
  }
  final String? videoPasswd = jsonConvert.convert<String>(json['videoPasswd']);
  if (videoPasswd != null) {
    loginEntity.videoPasswd = videoPasswd;
  }
  final String? businessUrl = jsonConvert.convert<String>(json['businessUrl']);
  if (businessUrl != null) {
    loginEntity.businessUrl = businessUrl;
  }
  final String? h5Url = jsonConvert.convert<String>(json['h5Url']);
  if (h5Url != null) {
    loginEntity.h5Url = h5Url;
  }
  final String? h5PdfUrl = jsonConvert.convert<String>(json['h5PdfUrl']);
  if (h5PdfUrl != null) {
    loginEntity.h5PdfUrl = h5PdfUrl;
  }
  final String? faceUrl = jsonConvert.convert<String>(json['faceUrl']);
  if (faceUrl != null) {
    loginEntity.faceUrl = faceUrl;
  }
  final String? videoUrl = jsonConvert.convert<String>(json['videoUrl']);
  if (videoUrl != null) {
    loginEntity.videoUrl = videoUrl;
  }
  return loginEntity;
}

Map<String, dynamic> $LoginEntityToJson(LoginEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['account'] = entity.account;
  data['passwd'] = entity.passwd;
  data['mobilephone'] = entity.mobilephone;
  data['phoneCode'] = entity.phoneCode;
  data['loginModel'] = entity.loginModel;
  data['machineId'] = entity.machineId;
  data['usr'] = entity.usr;
  data['ccd'] = entity.ccd;
  data['token'] = entity.token;
  data['videoAccount'] = entity.videoAccount;
  data['videoPasswd'] = entity.videoPasswd;
  data['businessUrl'] = entity.businessUrl;
  data['h5Url'] = entity.h5Url;
  data['h5PdfUrl'] = entity.h5PdfUrl;
  data['faceUrl'] = entity.faceUrl;
  data['videoUrl'] = entity.videoUrl;
  return data;
}

extension LoginEntityExtension on LoginEntity {
  LoginEntity copyWith({
    String? account,
    String? passwd,
    String? mobilephone,
    String? phoneCode,
    String? loginModel,
    String? machineId,
    String? usr,
    String? ccd,
    String? token,
    String? videoAccount,
    String? videoPasswd,
    String? businessUrl,
    String? h5Url,
    String? h5PdfUrl,
    String? faceUrl,
    String? videoUrl,
  }) {
    return LoginEntity()
      ..account = account ?? this.account
      ..passwd = passwd ?? this.passwd
      ..mobilephone = mobilephone ?? this.mobilephone
      ..phoneCode = phoneCode ?? this.phoneCode
      ..loginModel = loginModel ?? this.loginModel
      ..machineId = machineId ?? this.machineId
      ..usr = usr ?? this.usr
      ..ccd = ccd ?? this.ccd
      ..token = token ?? this.token
      ..videoAccount = videoAccount ?? this.videoAccount
      ..videoPasswd = videoPasswd ?? this.videoPasswd
      ..businessUrl = businessUrl ?? this.businessUrl
      ..h5Url = h5Url ?? this.h5Url
      ..h5PdfUrl = h5PdfUrl ?? this.h5PdfUrl
      ..faceUrl = faceUrl ?? this.faceUrl
      ..videoUrl = videoUrl ?? this.videoUrl;
  }
}